#include <limits.h>
#include "../inc/Tools.h"

void getVectorCirclesBoundingBox ( vector <Circle> _circles, float& _aMin, float& _bMin, float& _rMin, float& _aMax, float& _bMax, float& _rMax )
{
	_aMin = (float)LONG_MAX;
	_bMin = (float)LONG_MAX;
	_rMin = (float)LONG_MAX;
	_aMax = (float)LONG_MIN;
	_bMax = (float)LONG_MIN;
	_rMax = (float)LONG_MIN;
	
	for ( int i = 0 ; i < (int)_circles.size() ; i++ )
	{
		if ( _aMin > _circles[i].getA() )
			_aMin = _circles[i].getA();
		
		if ( _bMin > _circles[i].getB() )
			_bMin = _circles[i].getB();
		
		if ( _rMin > _circles[i].getR() )
			_rMin = _circles[i].getR();
		
		if ( _aMax < _circles[i].getA() )
			_aMax = _circles[i].getA();
		
		if ( _bMax < _circles[i].getB() )
			_bMax = _circles[i].getB();
		
		if ( _rMax < _circles[i].getR() )
			_rMax = _circles[i].getR();
	}
}

float scalarProduct2D ( Point _p1, Point _p2 )
{
	return (_p1.getX()*_p2.getX() + _p1.getY()*_p2.getY());
}


Point diffPoint ( Point _p1, Point _p2 )
{
	return Point ( _p1.getX()-_p2.getX(), _p1.getY()-_p2.getY(), _p1.getZ()-_p2.getZ(),0,0,0 );
}
